package org.yzh.protocol.jsatl12;

import io.github.yezhihao.protostar.DataType;
import io.github.yezhihao.protostar.annotation.Field;

import java.time.LocalDateTime;

/**
 * 报警标识号
 * @author yezhihao
 * @home https://gitee.com/yezhihao/jt808-server
 */
public class AlarmIdMultimedia {

    private String mobileNo;
    private int typeId;
    private LocalDateTime dateTime;
    private int multimediaType;
    private int serialNo;
    private int reserved;

    public AlarmIdMultimedia() {
    }

    public AlarmIdMultimedia(String mobileNo, int typeId, LocalDateTime dateTime, int multimediaType, int serialNo,
        int reserved) {
        this.mobileNo = mobileNo;
        this.typeId = typeId;
        this.dateTime = dateTime;
        this.multimediaType = multimediaType;
        this.serialNo = serialNo;
        this.reserved = reserved;
    }

    @Field(index = 0, type = DataType.BCD8421, length = 6, desc = "终端手机号")
    public String getMobileNo() {
        return mobileNo;
    }

    public void setMobileNo(String mobileNo) {
        this.mobileNo = mobileNo;
    }

    @Field(index = 6, type = DataType.WORD, desc = "报警/事件类型标识")
    public int getTypeId() {
        return typeId;
    }

    public void setTypeId(int type) {
        this.typeId = type;
    }

    @Field(index = 8, type = DataType.BCD8421, length = 6, desc = "报警时间")
    public LocalDateTime getDateTime() {
        return dateTime;
    }

    public void setDateTime(LocalDateTime dateTime) {
        this.dateTime = dateTime;
    }

    @Field(index = 14, type = DataType.BYTE, desc = "多媒体类型")
    public int getMultimediaType() {
        return multimediaType;
    }

    public void setMultimediaType(int multimediaType) {
        this.multimediaType = multimediaType;
    }

    @Field(index = 15, type = DataType.BYTE, desc = "同一时间点单个报警的附件序号，从 1 开始循环累加")
    public int getSerialNo() {
        return serialNo;
    }

    public void setSerialNo(int serialNo) {
        this.serialNo = serialNo;
    }

    @Field(index = 16, type = DataType.BYTE, desc = "预留")
    public int getReserved() {
        return reserved;
    }

    public void setReserved(int reserved) {
        this.reserved = reserved;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("AlarmIdMultimedia{");
        sb.append("mobileNo='").append(mobileNo).append('\'');
        sb.append(", typeId=").append(typeId);
        sb.append(", dateTime=").append(dateTime);
        sb.append(", multimediaType=").append(multimediaType);
        sb.append(", serialNo=").append(serialNo);
        sb.append(", reserved=").append(reserved);
        sb.append('}');
        return sb.toString();
    }
}